#include <cstdio>
using namespace std;

#define VECTOR_ROWS 2
#define VECTOR_COLS 3

int main()
{
    int v[VECTOR_ROWS][VECTOR_COLS];
    for (int i = 0; i < VECTOR_ROWS; i++)
        for (int j = 0; j < VECTOR_COLS; j++) {
            scanf("%d", &v[i][j]);
        }

    int new_v[VECTOR_COLS][VECTOR_ROWS];
    for (int i = 0; i < VECTOR_COLS; i++)
        for (int j = 0; j < VECTOR_ROWS; j++) 
            new_v[i][j] = v[j][i];

    for (int i = 0; i < VECTOR_COLS; i++) {
        for (int j = 0; j < VECTOR_ROWS; j++) 
            printf("%d ", new_v[i][j]);
        printf("\n");
    }

    return 0;
}